<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>simple</title>
    <script>
        (function () {

        })();

        function writeMsg(...args) {
            let msg = document.getElementById("msg")
            let d = ''
            for (let i = 0; i < args.length; i++) {
                d += ' ' + args[i]
            }
            msg.innerHTML += d + "<br>"
        }


        function testIPCEmit() {
            ipc.emit("test-ipc", [1234])
            ipc.emit("test-ipc", [4321], function (ret1, ret2) {
                writeMsg('ret1:', ret1, "ret2:", ret2);
            })
        }

        function CloseWindow() {
            ipc.emit("CloseWindow")
        }
        function Minimize() {
            ipc.emit("Minimize")
        }
        function Restore() {
            ipc.emit("Restore")
        }
        function Maximize() {
            ipc.emit("Maximize")
        }
        function FullScreen() {
            ipc.emit("FullScreen")
        }

        ipc.on('ipcOnName', function (data1) {
            writeMsg('ipcOnName-data1:', data1);
            return "new-data" + data1;
        })
    </script>
</head>
<body style="background: #4b5db4;margin: 0;padding: 0;min-height: 300px;min-width: 300px">
<p>
<h1 style="-webkit-app-region:drag;-webkit-user-select: none;border: solid 1px;text-align: center;">popup: drag title bar</h1>
</p>
<p>
    <button onclick="testIPCEmit()">testIPCEmit</button>
    <button onclick="CloseWindow()">CloseWindow</button>
    <button onclick="Minimize()">Minimize</button>
    <button onclick="Restore()">Restore</button>
    <button onclick="Maximize()">Maximize</button>
    <button onclick="FullScreen()">FullScreen</button>
</p>
<p>
    <a href="https://www.baidu.com">baidu</a>
    <a href="https://www.baidu.com" target="_blank">open-baidu</a>
    <a href="index.html" target="_blank">open-index</a>
</p>
<div id="msg"></div>
</body>
</html>